package com.xuecheng.manager_course.controller;

import com.xuecheng.api.course.CourseTeachplanControllerApi;
import com.xuecheng.framework.domain.course.Teachplan;
import com.xuecheng.framework.domain.course.TeachplanNode;
import com.xuecheng.framework.model.response.ResponseResult;
import com.xuecheng.manager_course.service.CourseTeachplanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/course/teachplan")
public class CourseTeachplanController implements CourseTeachplanControllerApi {

    @Autowired
    private CourseTeachplanService courseTeachplanService;


    @GetMapping("/list/{courseId}")
    @Override
    public TeachplanNode findTeachplanList(@PathVariable("courseId") String courseId) {
        return courseTeachplanService.findTeachplanList(courseId);
    }
    @PostMapping("/add")
    @Override
    public ResponseResult addTeachplan(@RequestBody Teachplan teachplan) {
        return courseTeachplanService.addTeachplan(teachplan);
    }
}
